package com.itheima.ZuoYe08;

import java.util.Calendar;

/*
请编程，计算并打印“1949年10月1日”那天是星期几？
 */
public class CalenderDemo {
    public static void main(String[] args) {
        Calendar c = Calendar.getInstance();

        c.set(Calendar.YEAR,1949);
        c.set(Calendar.MONTH,10-1);
        c.set(Calendar.DAY_OF_MONTH,1);

        int w = c.get(Calendar.DAY_OF_WEEK);
        System.out.println("1949年10月1日那天是"+getweek(w));


    }
    public static String getweek(int w){
        String [] weekArray = {"星期日","星期二","星期三","星期四","星期五","星期六","星期一"};
        return weekArray[w-1];
    }
}
